package com.jpcc.vw.onlineRadio.activity;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.jpcc.vw.onlineRadio.R;
import com.jpcc.vw.onlineRadio.adapter.PurchaseMemberAdapter;
import com.jpcc.vw.onlineRadio.model.bean.PurchaseMembershipEntity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 购买会员的Activity
 */
public class MemberShipActivity extends com.jpcc.vw.onlineRadio.base.BaseActivity {

    @BindView(R.id.recyclerview_purchase)
    RecyclerView recyclerview_purchase;
    @BindView(R.id.layout_back)
    RelativeLayout layout_back;
    @BindView(R.id.imv_top_search)
    ImageView imv_top_search;


    private PurchaseMemberAdapter adapter;
    private List<PurchaseMembershipEntity> datas=new ArrayList<>();

    @Override
    public int getLayoutId() {
        return R.layout.activity_membership_purchase;
    }

    @Override
    public void setupView() {
        ButterKnife.bind(this);
        layout_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MemberShipActivity.this.finish();
            }
        });
        imv_top_search.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MemberShipActivity.this,SearchActivity.class);
                startActivity(intent);
            }
        });
        for (int index=0;index<10;index++){
            PurchaseMembershipEntity entity=new PurchaseMembershipEntity();
            datas.add(entity);
        }
        adapter=new PurchaseMemberAdapter(this,datas);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setItemPrefetchEnabled(false);
        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerview_purchase.setLayoutManager(manager);
        recyclerview_purchase.setAdapter(adapter);
    }

    @Override
    public void setupData() {

    }
}
